home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI Developer Toolbox 6.1
/
SGI Developer Toolbox 6.1 - Disc 4.iso
/
findString
< prev
next >
Wrap
Text File
|
1994-08-01
|
1KB
|
31 lines
#! /bin/sh
# a "find" "script":
#
# one of the biggest headaches with something as large as the developer's
# toolbox, is finding the occurence of some string within a file somewhere
# in the melange of subtrees. remember that special characters or wild
# cards must either be enclosed by double quotes ("...") or "escaped" with
# a preceeding backslash ('\') character. some illustrative examples of
# the below sequence might be
#
# findString "Makefile.sgi_idb" '[-]t'
# find . -name "Makefile.sgi_idb" -print | xargs grep '[-]t'
#
# findString \*akefile\* '[-]t'
# find . -name \*akefile\* -print | xargs grep '[-]t'
#
# findString \*.c 'gconfig()'
# find . -name \*.c -print | xargs grep 'gconfig()'
#
# findString "*.c" doublebuffer\(\)
# find . -name "*.c" -print | xargs grep doublebuffer\(\)
#
if [ $# != 2 ]
then
echo "usage: findString filename/pattern string"
exit 1
fi
find . -name $1 -print | xargs grep $2